package com.zboot.zbootadmin.project.system.user.service;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONPObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zboot.zbootadmin.project.system.role.entity.vo.RoleVo;
import com.zboot.zbootadmin.project.system.user.domain.SysUser;
import com.zboot.zbootadmin.project.system.user.domain.dto.SearchDto;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.List;


public interface UserService extends IService<SysUser> {

    /**
     * 通过用户名查询用户信息
     * @param userName
     * @return
     */
    SysUser selectUserByUserName(String userName);
    /**
     *
     * @Description: 用户列表
     *
     * @author: zyt
     * @date: 20:31 2020/10/1
     * @param: [searchDto]
     * @return: com.alibaba.fastjson.JSONObject
     *
     */
    JSONObject getUserList(SearchDto searchDto);

    /**
     *
     * @Description: 导出
     *
     * @author: zyt
     * @date: 20:31 2020/10/1
     * @param: [uploadFile]
     * @return: java.util.List<com.zboot.zbootadmin.project.system.user.domain.SysUser>
     *
     */
    List<SysUser> ExportUserList(MultipartFile uploadFile);

    /**
     *
     * @Description: 保存用户
     *
     * @author: zyt
     * @date: 20:32 2020/10/1
     * @param: [sysUser]
     * @return: void
     *
     */
    void saveUser(SysUser sysUser);

    /**
     *
     * @Description: 根据id得到用户信息
     *
     * @author: zyt
     * @date: 20:32 2020/10/1
     * @param: [userId]
     * @return: com.zboot.zbootadmin.project.system.user.domain.SysUser
     *
     */
    SysUser getEditUser(String userId);

    /**
     *
     * @Description: 修改用户
     *
     * @author: zyt
     * @date: 20:37 2020/10/1
     * @param: []
     * @return: void
     *
     */
    void edit(SysUser sysUser);

    /**
     *
     * @Description: 获取所有的角色信息
     *
     * @author: zyt
     * @date: 20:42 2020/10/1
     * @param: []
     * @return: java.util.List<com.zboot.zbootadmin.project.system.role.entity.vo.RoleVo>
     *
     */
    List<RoleVo> getAllRoles ();

    /**
     *
     * @Description: 删除用户
     *
     * @author: zyt
     * @date: 10:05 2020/10/3
     * @param: [ids]
     * @return: void
     *
     */
    void deleteUser(String[] ids);

    /**
     *
     * @Description: 重置密码
     *
     * @author: zyt
     * @date: 10:50 2020/10/5
     * @param: [oldPassword, newPassword]
     * @return: void
     *
     */
    void resetPwd(String newPassword );

    /**
     *
     * @Description: 上传用户图片
     *
     * @author: zyt
     * @date: 21:57 2020/10/8
     * @param: [request, file]
     * @return: void
     *
     */
    String uploadPicture(HttpServletRequest request,MultipartFile file);
}
